import 'package:flutter_structure/app/app_device.dart';
import 'package:get_storage/get_storage.dart';
import 'package:get/get.dart';
import 'package:flutter_structure/common/controllers/state_controller.dart';
import 'package:flutter_structure/app/localization/localization_controller.dart';
import 'package:flutter_structure/app/theme/theme_controller.dart';
import 'package:flutter_structure/common/controllers/navigation_controller.dart';
import 'package:flutter_structure/modules/user/controllers/user_controller.dart';

Future <void> appInit() async {
  // 初始化设备信息
  final device = AppDevice();
  await device.initDeviceInfo();
  device.deviceInfo();

  // 注入全局 storage controller
  await GetStorage.init("theme_box");
  await GetStorage.init("locale_box");
  await GetStorage.init("app_state_box");
  await GetStorage.init("user_box");
  Get.put(ThemeController());
  Get.put(LanguageController());
  Get.put(UserController());
  Get.put(StateController());
  Get.put(NavigationController());
}